<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/5/9
  Time: 14:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>Title</title>
	<link rel="stylesheet" href="../css/login.css">
</head>
<body>
<div class="container">
	<div class="loginBox">
		<h1 style="color: PaleVioletRed">史上游戏最全攻略</h1>
		<div class="login">
			<form action="/zelda/login">
				<br>
				<!--账号-->
				<span style="color: blueviolet">账号: </span>
				<input id="username" name="username" type="text" placeholder="请输入账号">
				<br><br>
				<!--密码-->
				<span style="color: blueviolet">密码: </span>
				<input id="password" name="password" type="password" placeholder="请输入密码">
				<br><br>
				<!--登陆按键和注册按键-->
				<button type="submit" style="color:blueviolet" onclick="login()">登陆</button>
				<span>&nbsp;&nbsp;</span>
			</form>
			<button type="submit" style="color:blueviolet" onclick="register()">注册</button>
		</div>
	</div>
</div>
</body>
<script>
    function login() {
        var username = document.getElementById("username").value;
        var password = document.getElementById("password").value;
        if (username == '' || password == '') {
            alert("请输入账号和密码");
            return false;
        }
        return true;
    }
    function register(){
        window.location.href = "http://localhost:8081/jsp/register.jsp"
	}
</script>
</html>
